#define _CRT_SECURE_NO_WARNINGS 1
#include"Head.h"

class Solution {
public:
    int findMaxConsecutiveOnes(vector<int>& nums) {
        int count = 0, left = 0, right = 0;
        while (right < nums.size())
        {
            while (nums[right] != 1)
            {
                count = max(right - left, count);
                left = right + 1;
                break;
            }
            right++;
        }
        return max(count, right - left);
    }
};

int main1()
{
    Solution s;
    vector<int> v={1, 1, 0, 1, 1, 1};
    cout << s.findMaxConsecutiveOnes(v) << endl;
    return 0;
}